<template>
	<view>
		<view class="my_top relative w100">
			<image class="my_bg" src="../../static/img/my_bg.png"></image>
			<view class="absolute w100 my_con">
				<view class="padding-x-30 flex align-center justify-between">
					<view class="flex align-center" @click="changeSf()">
						<image style="width: 36rpx;height: 36rpx;" src="../../static/img/my_icon1.png"></image>
						<text class="fs-26 color-fff margin-left-10">切换{{is_user ? '商家端':'用户端'}}</text>
					</view>
					<image @click="jump('/pages/public/set')" src="../../static/img/my_icon2.png" style="width: 34rpx;height: 34rpx;"></image>
				</view>
				<view class="margin-left-48 margin-top-80 margin-right-30 flex align-center justify-between">
					<image @click="jump('/pages/my/changeInfo')" v-if="is_user" style="width: 120rpx;height: 120rpx;border-radius: 100%;"  :src="userInfo.avatar"></image>
					<image @click="jump('/pages/my/changeInfo')"  v-else style="width: 120rpx;height: 120rpx;border-radius: 100%;"  :src="shop_info.cover"></image>
					<view class="flex1 margin-left-24 margin-top-30 flex align-center justify-between">
						<view @click="jump('/pages/my/changeInfo')"  class="flex align-center">
							<text class="fs-30 color-333 margin-right-16" v-if="is_user">{{userInfo.name}}</text>
							<text class="fs-30 color-333 margin-right-16" v-else>{{shop_info.name}}</text>
							<image src="../../static/img/my_icon3.png" style="width: 36rpx;height: 36rpx;"></image>
						</view>
						<view  @click="jump('/pages/my/share')" class="flex align-center">
							<image src="../../static/img/my_icon4.png" style="width: 40rpx;height: 40rpx;margin-right: 30rpx;"></image>
							<image src="../../static/img/next2.png" style="width: 12rpx;height: 22rpx;"></image>
						</view>
					</view>
				</view>
				
				<view v-if="is_user" class="margin-left-48 margin-top-40 flex align-center">
					<view  @click="jump('/pages/my/focus')" class="text-center margin-right-48">
						<view class="fs-32 color-zhuse">{{userInfo.guanzhu}}</view>
						<view class="fs-24 color-333">关注</view>
					</view>
					<view  class="text-center margin-right-48">
						<view class="fs-32 color-zhuse">{{userInfo.fensi}}</view>
						<view class="fs-24 color-333">粉丝</view>
					</view>
					<view class="text-center margin-right-48">
						<view class="fs-32 color-zhuse">{{userInfo.like}}</view>
						<view class="fs-24 color-333">获赞量</view>
					</view>
				</view>
				
				<view v-if="!is_user" class="flex align-center justify-between padding-y-30 ">
					<view @click="jump('/pages/my/zijin')" class="text-center flex1">
						<image style="width: 60rpx;height: 60rpx;" src="../../static/img/sh_icon1.png"></image>
						<view class="fs-28 color-666">我的资金</view>
					</view>
					<view @click="jump('/pages/my/shop_rz?type=shop')" class="text-center flex1">
						<image style="width: 60rpx;height: 60rpx;" src="../../static/img/sh_icon2.png"></image>
						<view class="fs-28 color-666">资质认证</view>
					</view>
					<view @click="jump('/pages/public/kefu')" class="text-center flex1">
						<image style="width: 60rpx;height: 60rpx;" src="../../static/img/sh_icon3.png"></image>
						<view class="fs-28 color-666">我的客服</view>
					</view>
					<view @click="jump('/pages/my/video')" class="flex1 text-center">
						<image src="../../static/img/my_icon14.png" style="width: 60rpx;height: 60rpx;"></image>
						<view class="fs-28 color-666">我的视频</view>
					</view>
				</view>
				
			</view>
		</view>
		
		<view v-if="is_user" class="bg-f7f7f7 w100" style="height: 10rpx;"></view>
		<view v-if="is_user" class="padding-y-16 flex align-center justify-between">
			<view @click="jump('/pages/my/fabu')" class="flex1 text-center">
				<image src="../../static/img/my_icon5.png" style="width: 66rpx;height: 66rpx;"></image>
				<view class="fs-28 color-666">我的发布</view>
			</view>
			<view @click="jump('/pages/my/video')" class="flex1 text-center">
				<image src="../../static/img/my_icon14.png" style="width: 66rpx;height: 66rpx;"></image>
				<view class="fs-28 color-666">我的视频</view>
			</view>
			<view @click="jump('/pages/my/maidan')" class="flex1 text-center">
				<image src="../../static/img/my_icon6.png" style="width: 66rpx;height: 66rpx;"></image>
				<view class="fs-28 color-666">买单订单</view>
			</view>
			<view @click="jump('/pages/zhanghu/index')" class="flex1 text-center">
				<image src="../../static/img/my_icon7.png" style="width: 66rpx;height: 66rpx;"></image>
				<view class="fs-28 color-666">我的账户</view>
			</view>
		</view>
		<view class="bg-f7f7f7 w100" style="height: 10rpx;"></view>
		<view v-if="is_user">
			<view @click="jump('/pages/my/renzheng?type=member')" class="bg-fff solid-bottom padding-x-30 h50 flex align-center justify-between">
				<view class="flex align-center">
					<image style="width: 50rpx;height: 50rpx;" src="../../static/img/smrz.png"></image>
					<text class="fs-28 color-333 margin-left-10">我的认证</text>
				</view>
				<image src="../../static/img/next2.png" style="width: 14rpx;height: 24rpx;"></image>
			</view>
			<view @click="jump('/pages/my/collect')" class="bg-fff solid-bottom padding-x-30 h50 flex align-center justify-between">
				<view class="flex align-center">
					<image style="width: 50rpx;height: 50rpx;" src="../../static/img/my_icon8.png"></image>
					<text class="fs-28 color-333 margin-left-10">我的收藏</text>
				</view>
				<image src="../../static/img/next2.png" style="width: 14rpx;height: 24rpx;"></image>
			</view>
			<view @click="jump('/pages/my/history')" class="bg-fff solid-bottom padding-x-30 h50 flex align-center justify-between">
				<view class="flex align-center">
					<image style="width: 50rpx;height: 50rpx;" src="../../static/img/my_icon9.png"></image>
					<text class="fs-28 color-333 margin-left-10">历史记录</text>
				</view>
				<image src="../../static/img/next2.png" style="width: 14rpx;height: 24rpx;"></image>
			</view>
			<view @click="jump('/pages/video/fabu')" class="bg-fff solid-bottom padding-x-30 h50 flex align-center justify-between">
				<view class="flex align-center">
					<image style="width: 50rpx;height: 50rpx;" src="../../static/img/sh_icon11.png"></image>
					<text class="fs-28 color-333 margin-left-10">发布视频</text>
				</view>
				<image src="../../static/img/next2.png" style="width: 14rpx;height: 24rpx;"></image>
			</view>
			<view @click="jump('/pages/my/team')" class="bg-fff solid-bottom padding-x-30 h50 flex align-center justify-between">
				<view class="flex align-center">
					<image style="width: 50rpx;height: 50rpx;" src="../../static/img/sh_icon15.png"></image>
					<text class="fs-28 color-333 margin-left-10">我的分享</text>
				</view>
				<image src="../../static/img/next2.png" style="width: 14rpx;height: 24rpx;"></image>
			</view>
			<view @click="jump('/pages/my/my_order')" class="bg-fff solid-bottom padding-x-30 h50 flex align-center justify-between">
				<view class="flex align-center">
					<image style="width: 50rpx;height: 50rpx;" src="../../static/img/my_icon10.png"></image>
					<text class="fs-28 color-333 margin-left-10">我的预定</text>
				</view>
				<image src="../../static/img/next2.png" style="width: 14rpx;height: 24rpx;"></image>
			</view>
			<view @click="jump('/pages/my/jianli')" class="bg-fff solid-bottom padding-x-30 h50 flex align-center justify-between">
				<view class="flex align-center">
					<image style="width: 50rpx;height: 50rpx;" src="../../static/img/sh_icon12.png"></image>
					<text class="fs-28 color-333 margin-left-10">我的简历</text>
				</view>
				<image src="../../static/img/next2.png" style="width: 14rpx;height: 24rpx;"></image>
			</view>
			<view @click="jump('/pages/qiuzhi/fb_one')" class="bg-fff solid-bottom padding-x-30 h50 flex align-center justify-between">
				<view class="flex align-center">
					<image style="width: 50rpx;height: 50rpx;" src="../../static/img/sh_icon13.png"></image>
					<text class="fs-28 color-333 margin-left-10">发布招聘</text>
				</view>
				<image src="../../static/img/next2.png" style="width: 14rpx;height: 24rpx;"></image>
			</view>
			<view  @click="jump('/pages/qiuzhi/zhaopin')" class="bg-fff solid-bottom padding-x-30 h50 flex align-center justify-between">
				<view class="flex align-center">
					<image style="width: 50rpx;height: 50rpx;" src="../../static/img/sh_icon14.png"></image>
					<text class="fs-28 color-333 margin-left-10">收到简历</text>
				</view>
				<image src="../../static/img/next2.png" style="width: 14rpx;height: 24rpx;"></image>
			</view>
			<view @click="jump('/pages/my/ruzhu?member_id='+userInfo.id)" class="bg-fff solid-bottom padding-x-30 h50 flex align-center justify-between">
				<view class="flex align-center">
					<image style="width: 50rpx;height: 50rpx;" src="../../static/img/my_icon12.png"></image>
					<text class="fs-28 color-333 margin-left-10">商家入驻</text>
				</view>
				<image src="../../static/img/next2.png" style="width: 14rpx;height: 24rpx;"></image>
			</view>
			<!-- @click="jump('/pages/my/withdrawInfo?type=user')" -->
			<view  @click="toBank()" class="bg-fff solid-bottom padding-x-30 h50 flex align-center justify-between">
				<view class="flex align-center">
					<image style="width: 50rpx;height: 50rpx;" src="../../static/img/sh_icon8.png"></image>
					<text class="fs-28 color-333 margin-left-10">银行账户管理</text>
				</view>
				<image src="../../static/img/next2.png" style="width: 14rpx;height: 24rpx;"></image>
			</view>
			<view @click="jump('/pages/my/my_pingjia')" class="bg-fff solid-bottom padding-x-30 h50 flex align-center justify-between">
				<view class="flex align-center">
					<image style="width: 50rpx;height: 50rpx;" src="../../static/img/my_icon11.png"></image>
					<text class="fs-28 color-333 margin-left-10">我的评价</text>
				</view>
				<image src="../../static/img/next2.png" style="width: 14rpx;height: 24rpx;"></image>
			</view>
			<view @click="jump('/pages/public/kefu')"  class="bg-fff solid-bottom padding-x-30 h50 flex align-center justify-between">
				<view class="flex align-center">
					<image style="width: 50rpx;height: 50rpx;" src="../../static/img/my_icon13.png"></image>
					<text class="fs-28 color-333 margin-left-10">我的客服</text>
				</view>
				<image src="../../static/img/next2.png" style="width: 14rpx;height: 24rpx;"></image>
			</view>
		</view>
		
		<view v-if="!is_user">
			<view @click="jump('/pages/my/shopInfo?shop_id='+shop_info.id)" class="bg-fff solid-bottom padding-x-30 h50 flex align-center justify-between">
				<view class="flex align-center">
					<image style="width: 50rpx;height: 50rpx;" src="../../static/img/sh_icon4.png"></image>
					<text class="fs-28 color-333 margin-left-10">商家信息</text>
				</view>
				<image src="../../static/img/next2.png" style="width: 14rpx;height: 24rpx;"></image>
			</view>
			<view @click="jump('/pages/my/shoukuancode')" class="bg-fff solid-bottom padding-x-30 h50 flex align-center justify-between">
				<view class="flex align-center">
					<image style="width: 50rpx;height: 50rpx;" src="../../static/img/sh_icon16.png"></image>
					<text class="fs-28 color-333 margin-left-10">收款码</text>
				</view>
				<image src="../../static/img/next2.png" style="width: 14rpx;height: 24rpx;"></image>
			</view>
			<view @click="jump('/pages/my/banner')" class="bg-fff solid-bottom padding-x-30 h50 flex align-center justify-between">
				<view class="flex align-center">
					<image style="width: 50rpx;height: 50rpx;" src="../../static/img/sh_icon11.png"></image>
					<text class="fs-28 color-333 margin-left-10">轮播图</text>
				</view>
				<image src="../../static/img/next2.png" style="width: 14rpx;height: 24rpx;"></image>
			</view>
			<view @click="jump('/pages/my/shopGoods?shop_id='+shop_info.id)" class="bg-fff solid-bottom padding-x-30 h50 flex align-center justify-between">
				<view class="flex align-center">
					<image style="width: 50rpx;height: 50rpx;" src="../../static/img/sh_icon5.png"></image>
					<text class="fs-28 color-333 margin-left-10">商家商品</text>
				</view>
				<image src="../../static/img/next2.png" style="width: 14rpx;height: 24rpx;"></image>
			</view>
			<view @click="jump('/pages/my/fangjian_two?cate_id='+shop_info.classify_pid+'&shop_id='+shop_info.id)" class="bg-fff solid-bottom padding-x-30 h50 flex align-center justify-between">
				<view class="flex align-center">
					<image style="width: 50rpx;height: 50rpx;" src="../../static/img/sh_icon6.png"></image>
					<text class="fs-28 color-333 margin-left-10">{{shop_info.classify_pid == 1 ? '我的菜单':'我的房间'}}</text>
				</view>
				<image src="../../static/img/next2.png" style="width: 14rpx;height: 24rpx;"></image>
			</view>
			<view @click="jump('/pages/video/fabu')" class="bg-fff solid-bottom padding-x-30 h50 flex align-center justify-between">
				<view class="flex align-center">
					<image style="width: 50rpx;height: 50rpx;" src="../../static/img/sh_icon11.png"></image>
					<text class="fs-28 color-333 margin-left-10">发布视频</text>
				</view>
				<image src="../../static/img/next2.png" style="width: 14rpx;height: 24rpx;"></image>
			</view>
			<view @click="jump('/pages/qiuzhi/fb_one')" class="bg-fff solid-bottom padding-x-30 h50 flex align-center justify-between">
				<view class="flex align-center">
					<image style="width: 50rpx;height: 50rpx;" src="../../static/img/sh_icon13.png"></image>
					<text class="fs-28 color-333 margin-left-10">发布招聘</text>
				</view>
				<image src="../../static/img/next2.png" style="width: 14rpx;height: 24rpx;"></image>
			</view>
			<view @click="jump('/pages/qiuzhi/zhaopin')" class="bg-fff solid-bottom padding-x-30 h50 flex align-center justify-between">
				<view class="flex align-center">
					<image style="width: 50rpx;height: 50rpx;" src="../../static/img/sh_icon14.png"></image>
					<text class="fs-28 color-333 margin-left-10">收到简历</text>
				</view>
				<image src="../../static/img/next2.png" style="width: 14rpx;height: 24rpx;"></image>
			</view>
			<view @click="jump('/pages/my/zhanghu')" class="bg-fff solid-bottom padding-x-30 h50 flex align-center justify-between">
				<view class="flex align-center">
					<image style="width: 50rpx;height: 50rpx;" src="../../static/img/sh_icon7.png"></image>
					<text class="fs-28 color-333 margin-left-10">账户管理统计</text>
				</view>
				<image src="../../static/img/next2.png" style="width: 14rpx;height: 24rpx;"></image>
			</view>
			<view @click="jump('/pages/my/jiaofei')" class="bg-fff solid-bottom padding-x-30 h50 flex align-center justify-between">
				<view class="flex align-center">
					<image style="width: 50rpx;height: 50rpx;" src="../../static/img/sh_icon10.png"></image>
					<text class="fs-28 color-333 margin-left-10">商家缴平台费用</text>
				</view>
				<image src="../../static/img/next2.png" style="width: 14rpx;height: 24rpx;"></image>
			</view>
			<!-- @click="jump('/pages/my/withdrawInfo?type=shop')" -->
			<view @click="toBank()" class="bg-fff solid-bottom padding-x-30 h50 flex align-center justify-between">
				<view class="flex align-center">
					<image style="width: 50rpx;height: 50rpx;" src="../../static/img/sh_icon8.png"></image>
					<text class="fs-28 color-333 margin-left-10">银行账户管理</text>
				</view>
				<image src="../../static/img/next2.png" style="width: 14rpx;height: 24rpx;"></image>
			</view>
			<view @click="jump('/pages/canyin/comment?shop_id='+shop_info.id)"  class="bg-fff solid-bottom padding-x-30 h50 flex align-center justify-between">
				<view class="flex align-center">
					<image style="width: 50rpx;height: 50rpx;" src="../../static/img/sh_icon9.png"></image>
					<text class="fs-28 color-333 margin-left-10">评价管理</text>
				</view>
				<image src="../../static/img/next2.png" style="width: 14rpx;height: 24rpx;"></image>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				is_user:true,
				userInfo:{},
				shop_info:{}
			}
		},
		onShow() {
			this.getInfo();
			this.getConf()
		},
		methods:{
			getConf(){
				this.$api.conf().then(res => {
					if (res.code == 1) {
						uni.setStorageSync('conf',JSON.stringify(res.data))
					}
				})
			},
			getInfo(){
				this.$api.material().then(res=>{
					if(res.code == 1){
						this.userInfo = res.data.data
					}
				})
			},
			// 切换身份
			changeSf(){
				var data = {type:this.is_user ? 'shop':'member'}
				this.$api.cut_shenfen(data).then(res=>{
					if(res.code == 1){
						this.is_user = !this.is_user;
						if(this.is_user){
							this.userInfo = res.data
						}else{
							this.shop_info = res.data
						}
					}else{
						this.$msg(res.msg)
					}
				})
			},
			
			// 银行账户管理
			toBank(){
				this.$msg('暂未开通')
			}
		}
	}
</script>

<style lang="scss" scoped>
	.my_top{
		height: 480rpx;
		.my_bg{
			width: 100%;
			height: 100%;
		}
		.my_con{
			top: 0;
			padding-top: 80rpx;
		}
	}
</style>
